import type { App } from 'vue'
import { Icon } from './Icon'
import { Permission } from './Permission'
import { BaseButton } from './Button'
import * as BusinessComponents from './Business'

export const setupGlobCom = (app: App<Element>): void => {
  app.component('Icon', Icon)
  app.component('Permission', Permission)
  app.component('BaseButton', BaseButton)

  // 注册所有 Business 组件为全局组件
  Object.entries(BusinessComponents).forEach(([name, component]) => {
    app.component(name, component)
  })
}
